
import request from "../utils/request";
// /xhr/index.json  获取首页数据
export const infoHome = () => {
  return request.get('/xhr/index.json')
}
// /xhr/index/items.json
export const infolist = (data: any) => {
  return request.post('/xhr/index.json', {
    params: data
  })
}
// 轮播图数据 /topic/v1/know/navWap.json
export const getBannerList = () => {
  return request.get(`/topic/v1/know/navWap.json`)
}

// 首页瀑布流数据
export const getHomeWaterFall = (timedate: number) => {
  return request.get<any, homeWaterFall>(`/xhr/index.json?__timestamp=${timedate}`)
}
//轮播图
export const getBannerListTwo = (timestamp: number) => {
  return request.get<any, any>(`/xhr/index.json?csrf_token=ee8d74b3585d8edb9b15ea10b2a4d8df&__timestamp=${timestamp}`)
}

// 定义瀑布流返回数据类型
interface homeWaterFall {
  code: number,
  data: {
    data: {
      indexActivityModule: activityModuleType[]
    }
  }
}

export interface activityModuleType {
  "picUrl": string,
  "activityPrice": string,
  "subTitle": string,
  "originPrice": string,
  "tag": string,
  "title": string,
  "targetUrl": string,
  "showPicUrl": string
}

